import os.path
os.path.isfile(fname)


class Myreadfile():
    N = 0
    A = []
    B = []

    def __init__(self, filepath):
        if not os.path.isfile(filepath):
            print("文件不存在")
        self.Datfile = open(filepath)
        self.file = Datfile.readlines()

    def get_N():
        self.N = int(self.file[0])

    def get_A():


Datfile = open("./Nugent15/data/nug15.dat")
# 获取N的个数
file = Datfile.readlines()
s = file[0]
print(s)
N = int(s)
print(N)
# 获取矩阵A
c
# 获取矩阵B
B = []
for i in range(2+N+1, 2+N+N):
    temp = file[i][:-1].split(" ")
    temp = [i for i in temp if i != ""]
    print(temp)
    B.append([int(j) for j in temp])
print(B)   # 读取矩阵A完毕

# for i in range(3, 3+N):
#     for j in i:
#         if j in "0123456789"

# temp = file[3]
# print(temp)
# print(list(temp))

# for line in A:

#     s = line.strip().split('\t')
#     print(s)
#     # sentimentlist.append(s)
Datfile.close()
